package com.tfjybj.itoo.exam.provider.service.impl;

import com.dmsdbj.itoo.tool.base.service.impl.BaseServicePlusImpl;
import com.tfjybj.itoo.exam.entity.DatumEntity;
import com.tfjybj.itoo.exam.model.DatumModel;
import com.tfjybj.itoo.exam.provider.dao.DatumDao;
import com.tfjybj.itoo.exam.provider.service.DatumService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * DatumService接口实现类
 * ${base}表
 *
 * @author 贾建清
 * @version 2.0.0
 * @since 2.0.0 2018-12-08 12:31:48
 */
@Service("datumService")
public class DatumServiceImpl extends BaseServicePlusImpl<DatumDao, DatumEntity> implements DatumService {


    @Resource
    private DatumDao datumDao;

    //endregion

    /* **********************************以下为非模板生成的内容********************************* */


    @Override
    public String queryExcelPath(String questionTypeId) {
        List<DatumEntity> datum = this.datumDao.selectDatumURL(questionTypeId);
        if (datum.size() == 0) {
            return null;
        } else {
            return datum.get(0).getDatumUrl();
        }

    }

    @Override
    public List<DatumModel> selectQuestionTypeId(String questionTypeId) {
        return datumDao.selectQuestionTypeId(questionTypeId);
    }
}
